package com.salt.admin.api.feign.client;

import com.salt.admin.api.feign.hystrix.AreaClientHystrix;
import com.salt.admin.api.feign.interceptor.FeignTokenInterceptor;
import com.salt.admin.api.model.Area;
import com.salt.common.constant.Common;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Description 区域FeignClient
 * @Author salt
 * @Date 2020/6/18 14:45
 * @Version 1.0
 */
@FeignClient(name = Common.Service.SALT_ADMIN_SERVICE_NAME,
        path = Common.Service.SALT_ADMIN_AREA_URL_PREFIX,
        fallbackFactory = AreaClientHystrix.class,
        configuration = FeignTokenInterceptor.class)
public interface AreaClient {

    @PostMapping("getById")
    public Area get(@RequestParam("id") String id);

    @PostMapping("getByName")
    public Area getByAreaName(@RequestParam("name") String name);
}
